#include <stdio.h>
#include <pthread.h>

void*handler_fun(void*arg)
{
    int var = *((int*)arg);
    printf("in pehread:%d\n",var);
    //pthread_exit(NULL);//exit
}

int main(int argc,const char*argv[])
{
    pthread_t tid;
    int a = 100;
    if(pthread_create(&tid,NULL,handler_fun,&a)!=0)
    {
        perror("pthread create err");
        return -1;
    }
    //sleep(1);
    printf("in main\n");
    pthread_join(tid,NULL);//wait
    return 0;
}